package com.glsc.ngateway.common.api.flowable.dto.task.formData.cmdb;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.glsc.ngateway.common.api.flowable.dto.FlowFormNewCPUStandardDetailDto;
import com.glsc.ngateway.common.api.flowable.dto.FlowFormNewDiskStandardDetailDto;
import com.glsc.ngateway.common.api.flowable.dto.FlowFormNewMemoryStandardDetailDto;
import com.glsc.ngateway.common.api.flowable.dto.FlowFormNewPartStandardDetailDto;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.AbstractTaskFormDataDto;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.cmdb.domainDto.FlowFormPartStandardModifyDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.util.List;
import java.util.Objects;

/**
 * 配件规格新增/修改流程外层数据dto
 * @author zhengyr
 */
@ToString(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper=true)
public class PartStandardModifyTaskFormDto extends AbstractTaskFormDataDto<FlowFormPartStandardModifyDto> {

    @ApiModelProperty(value = "子表-变更cpu规格")
    List<FlowFormNewCPUStandardDetailDto> cpuStandardNewDataList;
    @ApiModelProperty(value = "子表-变更内存规格")
    List<FlowFormNewMemoryStandardDetailDto> memoryStandardNewDataList;
    @ApiModelProperty(value = "子表-变更硬盘规格")
    List<FlowFormNewDiskStandardDetailDto> diskStandardNewDataList;
    @ApiModelProperty(value = "子表-变更其他配件规格")
    List<FlowFormNewPartStandardDetailDto> partStandardNewDataList;

    @Override
    public String getSystemAdminAccount() {
        return this.getFormMainData().getSystemAdminAccount();
    }

    @Override
    public String getProcessTitle() {
        return this.getFormMainData().getProcessTitle();
    }

    @Override
    public void setProcessId(String processId) {
        if(Objects.nonNull(this.getFormMainData())) {
            this.getFormMainData().setProcessId(processId);
        }
    }

    @Override
    public String getProcessId() {
        return this.getFormMainData().getProcessId();
    }

}
